      module dag_parallel
      implicit none
      integer*8 :: addr1,addr2
      type ARG_TYPE
        integer:: iter,starti,endi,startj,endj
      end type ARG_TYPE
      real(8),allocatable :: A(:,:,:)
      real(8),allocatable :: test(:,:,:)
      end module dag_parallel


      subroutine sws_2d5p_core(args)
      use dag_parallel
      implicit none
      include "init.for"
#include "aceMesh_runtime_f.h"
#define alpha 0.0876
#define beta 0.0765

      type(ARG_TYPE) :: args
      integer :: starti,endi,startj,endj,it
      integer :: i,j,dest,src

      !print *,"before"
      starti = args%starti
      endi = args%endi
      startj = args%startj
      endj = args%endj
      it = args%iter
      dest = mod(it,2)+1
      src  = mod(it+1,2)+1
      do i=starti,endi
      do j=startj,endj
        A(j,i,dest) = alpha * A(j,i,src) +beta * (A(j,i+1,src) + A(j+1,i,src)+ A(j,i-1,src)+ A(j-1,i,src))
      enddo
      enddo

      !print *,"end"
	  end subroutine